﻿using System;
using System.Text;

using BizElements.Core;
using BizElements.Core.ProviderComponents;

namespace BizElements.Core.MySql
{
    sealed class MySqlColumnRenderer : IColumnRenderer
    {
        public void RenderColumnName(IDbColumn column, StringBuilder output)
        {
            // Special characters must be enclosed by backtick characters.
            output.Append("`");
            output.Append(column.ColumnName);
            output.Append("`");
        }

        public void RenderAlias(IDbColumn column, StringBuilder output)
        {
            // Special characters must be enclosed by backtick characters.
            output.Append("`");
            output.Append(column.Alias);
            output.Append("`");
        }
    }
}